<!DOCTYPE html>
<html>
<head>
    <title>Nuclear Decay Equation</title>
    <style>
        body {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
            background-color: #f0f0f0;
        }
        canvas {
            border: 1px solid #ccc;
            background-color: #fff;
        }
    </style>
</head>
<body>
    <canvas id="nuclearDecayCanvas" width="750" height="250"></canvas>
    <script>
        const canvas = document.getElementById('nuclearDecayCanvas');
        const ctx = canvas.getContext('2d');

        // Clear canvas
        ctx.fillStyle = 'white';
        ctx.fillRect(0, 0, canvas.width, canvas.height);

        // Set drawing properties
        ctx.fillStyle = 'black';
        ctx.strokeStyle = 'black';
        ctx.lineWidth = 3;

        // Set a vertical center for alignment
        const y_center = 125;
        const mainFontSize = 50;
        const subSuperFontSize = 32;

        // --- Draw the equation ---
        
        // 1. Polonium-211
        let current_x = 50;
        
        // Superscript and subscript
        ctx.font = `${subSuperFontSize}px Arial`;
        ctx.textAlign = 'right';
        ctx.fillText("211", current_x + 40, y_center - mainFontSize * 0.5);
        ctx.fillText("84", current_x + 40, y_center + mainFontSize * 0.5);

        // Element symbol
        ctx.font = `${mainFontSize}px Arial`;
        ctx.textAlign = 'left';
        ctx.fillText("Po", current_x + 50, y_center + 10);
        
        current_x += 130;

        // 2. Arrow
        const arrow_start_x = current_x + 20;
        const arrow_end_x = arrow_start_x + 80;
        ctx.beginPath();
        ctx.moveTo(arrow_start_x, y_center);
        ctx.lineTo(arrow_end_x, y_center);
        // Arrowhead
        ctx.moveTo(arrow_end_x, y_center);
        ctx.lineTo(arrow_end_x - 15, y_center - 10);
        ctx.moveTo(arrow_end_x, y_center);
        ctx.lineTo(arrow_end_x - 15, y_center + 10);
        ctx.stroke();

        current_x = arrow_end_x + 30;
        
        // 3. Lead (Pb) with blanks
        const dots = ".......";
        
        // Superscript and subscript blanks
        ctx.font = `${subSuperFontSize}px Arial`;
        ctx.textAlign = 'right';
        ctx.fillText(dots, current_x + 60, y_center - mainFontSize * 0.5);
        ctx.fillText(dots, current_x + 60, y_center + mainFontSize * 0.5);
        
        // Element symbol
        ctx.font = `${mainFontSize}px Arial`;
        ctx.textAlign = 'left';
        ctx.fillText("Pb", current_x + 70, y_center + 10);

        current_x += 150;

        // 4. Plus sign
        ctx.font = `${mainFontSize}px Arial`;
        ctx.textAlign = 'center';
        ctx.fillText("+", current_x + 30, y_center + 10);

        current_x += 60;

        // 5. Alpha particle with blanks
        current_x += 30;

        // Superscript and subscript blanks
        ctx.font = `${subSuperFontSize}px Arial`;
        ctx.textAlign = 'right';
        ctx.fillText(dots, current_x + 60, y_center - mainFontSize * 0.5);
        ctx.fillText(dots, current_x + 60, y_center + mainFontSize * 0.5);

        // Alpha symbol (using a serif font for the specific style)
        ctx.font = `${mainFontSize}px 'Times New Roman'`;
        ctx.textAlign = 'left';
        ctx.fillText("α", current_x + 70, y_center + 10);

    </script>
</body>
</html>